#ifndef BUTTON_H_
#define BUTTON_H_

#include <iostream>
#include "../Widget.h"
#include "SDL/SDL_ttf.h"
#include "../../common/Constantes.h"
#include "../Listener.h"
#include "../../common/utils/Logger.h"
#include "../Parcel.h"
#include "../Event.h"

class Button: public Widget {

public:
	Button(std::string buttonName,int posX, int posY,Widget* parent, Listener * listener,SDL_Surface* presssedStatus,SDL_Surface* defaultStatus);
	virtual ~Button();
	virtual void handleEvent(Event event);
	virtual void resolve();
	virtual void showOn(SDL_Surface* surface);

private:
	Parcel parcel;
	std::string buttonName;
	Listener* listener;
	SDL_Surface* pressedSurface;
	SDL_Surface* defaultSurface;
	SDL_Surface* activeSurface;

	bool mouseIsOver;
	Uint8 state;
	bool pressed;

	bool mouseOver(Event event) const;

};

#endif /* BUTTON_H_ */
